<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据管理 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }

        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }

        .header-right {
            display: flex;
            align-items: center;
        }

        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }

        .header-action:hover {
            color: var(--primary-color);
        }

        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }

        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-menu {
            padding: 16px 0;
        }

        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
        }

        .page-actions .btn {
            margin-left: 10px;
        }

        /* 设置区域 */
        .settings-container {
            display: flex;
            flex: 1;
            gap: 20px;
        }

        /* 设置侧边导航 */
        .settings-nav {
            width: 240px;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            flex-shrink: 0;
        }

        .nav-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            font-weight: 500;
            color: var(--text-primary);
        }

        .nav-items {
            padding: 8px 0;
        }

        .nav-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .nav-item:hover {
            background: rgba(52, 152, 219, 0.05);
            color: var(--primary-color);
        }

        .nav-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .nav-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 设置内容区域 */
        .settings-content {
            flex: 1;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
        }

        .content-header {
            padding: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .content-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .content-description {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .content-body {
            padding: 20px;
            flex: 1;
            overflow-y: auto;
        }

        .settings-section {
            margin-bottom: 32px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
        }

        .section-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }

        .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        .form-textarea {
            min-height: 100px;
            resize: vertical;
        }

        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            background: white;
            font-size: 14px;
        }

        .form-check {
            display: flex;
            align-items: center;
        }

        .form-check-input {
            margin-right: 8px;
        }

        .form-check-label {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .form-row {
            display: flex;
            gap: 16px;
        }

        .form-col {
            flex: 1;
        }

        .file-upload {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        .file-input {
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
        }

        .file-label {
            display: block;
            padding: 10px 12px;
            border: 1px dashed var(--border-color);
            border-radius: 4px;
            text-align: center;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .file-label:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .content-footer {
            padding: 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn i {
            margin-right: 6px;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            background: #f5f7fa;
        }

        .btn-success {
            background: var(--success-color);
            color: white;
        }

        .btn-success:hover {
            background: #219653;
        }

        .btn-danger {
            background: var(--danger-color);
            color: white;
        }

        .btn-danger:hover {
            background: #c0392b;
        }

        /* 数据管理特定样式 */
        .backup-card {
            background: #f9fafc;
            border-radius: 4px;
            padding: 16px;
            margin-bottom: 16px;
            border: 1px solid var(--border-color);
        }

        .backup-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .backup-title {
            font-weight: 500;
            display: flex;
            align-items: center;
        }

        .backup-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .backup-meta {
            display: flex;
            color: var(--text-muted);
            font-size: 13px;
            margin-bottom: 12px;
        }

        .backup-meta-item {
            margin-right: 16px;
            display: flex;
            align-items: center;
        }

        .backup-meta-item i {
            margin-right: 4px;
        }

        .backup-actions {
            display: flex;
            gap: 8px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 20px;
        }

        .stat-item {
            background: #f9fafc;
            border-radius: 4px;
            padding: 16px;
            text-align: center;
        }

        .stat-value {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 4px;
            color: var(--primary-color);
        }

        .stat-label {
            font-size: 13px;
            color: var(--text-muted);
        }

        .progress-bar {
            height: 8px;
            background: #e3e5e7;
            border-radius: 4px;
            overflow: hidden;
            margin: 12px 0;
        }

        .progress-fill {
            height: 100%;
            background: var(--primary-color);
            border-radius: 4px;
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .settings-container {
                flex-direction: column;
            }

            .settings-nav {
                width: 100%;
            }

            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }

            .sidebar.open {
                left: 0;
            }

            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }

            .overlay.open {
                display: block;
            }
        }

        @media (max-width: 768px) {
            .form-row {
                flex-direction: column;
                gap: 0;
            }

            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }

            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .backup-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .backup-actions {
                margin-top: 12px;
                width: 100%;
                justify-content: space-between;
            }
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站后台
            </div>
        </div>

        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>

            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>

            <div class="user-menu">
                <span>管理员</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">主导航</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-home"></i>
                    <span>控制台</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-paint-brush"></i>
                    <span>网站管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>页面管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-th-large"></i>
                    <span>组件库</span>
                </a>

                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>文章管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>产品管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>媒体库</span>
                </a>

                <div class="menu-title">用户与权限</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-users"></i>
                    <span>用户管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>角色权限</span>
                </a>
                <a href="#" class="menu-item active">
                    <i class="fas fa-cog"></i>
                    <span>系统设置</span>
                </a>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">系统设置</h1>
                <div class="page-actions">
                    <button class="btn btn-outline">
                        <i class="fas fa-history"></i> 恢复默认
                    </button>
                    <button class="btn btn-primary">
                        <i class="fas fa-save"></i> 保存设置
                    </button>
                </div>
            </div>

            <!-- 设置区域 -->
            <div class="settings-container">
                <!-- 设置导航 -->
                <div class="settings-nav">
                    <div class="nav-header">设置分类</div>
                    <div class="nav-items">
                        <a href="#" class="nav-item">
                            <i class="fas fa-globe"></i>
                            <span>基本设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-lock"></i>
                            <span>安全设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-paint-brush"></i>
                            <span>外观设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-envelope"></i>
                            <span>邮件设置</span>
                        </a>
                        <a href="#" class="nav-item active">
                            <i class="fas fa-database"></i>
                            <span>数据管理</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-plug"></i>
                            <span>第三方服务</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-code"></i>
                            <span>自定义代码</span>
                        </a>
                    </div>
                </div>

                <!-- 设置内容 -->
                <div class="settings-content">
                    <div class="content-header">
                        <div class="content-title">数据管理</div>
                        <div class="content-description">管理系统数据备份、恢复和清理操作</div>
                    </div>

                    <div class="content-body">
                        <!-- 系统统计 -->
                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-chart-bar"></i>
                                系统数据统计
                            </div>

                            <div class="stats-grid">
                                <div class="stat-item">
                                    <div class="stat-value">2.5 GB</div>
                                    <div class="stat-label">数据库大小</div>
                                    <div class="progress-bar">
                                        <div class="progress-fill" style="width: 65%"></div>
                                    </div>
                                    <div style="font-size: 13px; color: var(--text-muted);">总容量: 4.0 GB</div>
                                </div>

                                <div class="stat-item">
                                    <div class="stat-value">1,247</div>
                                    <div class="stat-label">网站数量</div>
                                </div>

                                <div class="stat-item">
                                    <div class="stat-value">5,832</div>
                                    <div class="stat-label">页面数量</div>
                                </div>
                            </div>
                        </div>

                        <!-- 数据备份 -->
                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-download"></i>
                                数据备份
                            </div>

                            <div class="form-group">
                                <label class="form-label">备份类型</label>
                                <select class="form-select">
                                    <option>完整备份（数据库+文件）</option>
                                    <option>仅数据库</option>
                                    <option>仅上传文件</option>
                                </select>
                            </div>

                            <div class="form-group">
                                <label class="form-label">备份说明</label>
                                <input type="text" class="form-input" placeholder="输入本次备份的说明信息">
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="backupCompression" checked>
                                    <label class="form-check-label" for="backupCompression">启用压缩</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="backupEncryption">
                                    <label class="form-check-label" for="backupEncryption">启用加密</label>
                                </div>
                            </div>

                            <button class="btn btn-primary">
                                <i class="fas fa-download"></i> 立即备份
                            </button>
                        </div>

                        <!-- 备份列表 -->
                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-history"></i>
                                备份记录
                            </div>

                            <div class="backup-card">
                                <div class="backup-header">
                                    <div class="backup-title">
                                        <i class="fas fa-database"></i>
                                        完整系统备份
                                    </div>
                                    <div style="color: var(--success-color); font-weight: 500;">
                                        <i class="fas fa-check-circle"></i> 成功
                                    </div>
                                </div>
                                <div class="backup-meta">
                                    <div class="backup-meta-item">
                                        <i class="fas fa-calendar"></i> 2023-09-04 14:30
                                    </div>
                                    <div class="backup-meta-item">
                                        <i class="fas fa-weight-hanging"></i> 1.2 GB
                                    </div>
                                </div>
                                <div class="backup-actions">
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-download"></i> 下载
                                    </button>
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-undo"></i> 恢复
                                    </button>
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-trash"></i> 删除
                                    </button>
                                </div>
                            </div>

                            <div class="backup-card">
                                <div class="backup-header">
                                    <div class="backup-title">
                                        <i class="fas fa-database"></i>
                                        仅数据库备份
                                    </div>
                                    <div style="color: var(--success-color); font-weight: 500;">
                                        <i class="fas fa-check-circle"></i> 成功
                                    </div>
                                </div>
                                <div class="backup-meta">
                                    <div class="backup-meta-item">
                                        <i class="fas fa-calendar"></i> 2023-09-03 09:15
                                    </div>
                                    <div class="backup-meta-item">
                                        <i class="fas fa-weight-hanging"></i> 350 MB
                                    </div>
                                </div>
                                <div class="backup-actions">
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-download"></i> 下载
                                    </button>
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-undo"></i> 恢复
                                    </button>
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-trash"></i> 删除
                                    </button>
                                </div>
                            </div>

                            <div class="backup-card">
                                <div class="backup-header">
                                    <div class="backup-title">
                                        <i class="fas fa-database"></i>
                                        完整系统备份
                                    </div>
                                    <div style="color: var(--warning-color); font-weight: 500;">
                                        <i class="fas fa-exclamation-triangle"></i> 部分成功
                                    </div>
                                </div>
                                <div class="backup-meta">
                                    <div class="backup-meta-item">
                                        <i class="fas fa-calendar"></i> 2023-09-01 18:45
                                    </div>
                                    <div class="backup-meta-item">
                                        <i class="fas fa-weight-hanging"></i> 980 MB
                                    </div>
                                </div>
                                <div class="backup-actions">
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-download"></i> 下载
                                    </button>
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-undo"></i> 恢复
                                    </button>
                                    <button class="btn btn-outline btn-sm">
                                        <i class="fas fa-trash"></i> 删除
                                    </button>
                                </div>
                            </div>
                        </div>

                        <!-- 数据恢复 -->
                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-upload"></i>
                                数据恢复
                            </div>

                            <div class="form-group">
                                <label class="form-label">选择备份文件</label>
                                <select class="form-select">
                                    <option>选择要恢复的备份...</option>
                                    <option>完整系统备份 (2023-09-04 14:30)</option>
                                    <option>仅数据库备份 (2023-09-03 09:15)</option>
                                    <option>完整系统备份 (2023-09-01 18:45)</option>
                                </select>
                            </div>

                            <div class="form-group">
                                <label class="form-label">或上传备份文件</label>
                                <div class="file-upload">
                                    <input type="file" class="file-input" accept=".zip,.sql,.bak">
                                    <div class="file-label">
                                        <i class="fas fa-upload"></i> 点击上传备份文件
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="restoreVerification">
                                    <label class="form-check-label" for="restoreVerification">恢复前验证备份完整性</label>
                                </div>
                            </div>

                            <button class="btn btn-danger">
                                <i class="fas fa-undo"></i> 恢复数据
                            </button>
                        </div>

                        <!-- 数据清理 -->
                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-broom"></i>
                                数据清理
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="cleanRevisions">
                                    <label class="form-check-label" for="cleanRevisions">清理页面修订版本</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="cleanAutoDrafts">
                                    <label class="form-check-label" for="cleanAutoDrafts">清理自动草稿</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="cleanTrash">
                                    <label class="form-check-label" for="cleanTrash">清空回收站</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="cleanTransients">
                                    <label class="form-check-label" for="cleanTransients">清理临时数据</label>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="cleanOrphanData">
                                    <label class="form-check-label" for="cleanOrphanData">清理孤儿数据</label>
                                </div>
                            </div>

                            <button class="btn btn-danger">
                                <i class="fas fa-broom"></i> 执行清理
                            </button>
                        </div>
                    </div>

                    <div class="content-footer">
                        <button class="btn btn-outline">
                            <i class="fas fa-times"></i> 取消
                        </button>
                        <button class="btn btn-primary">
                            <i class="fas fa-save"></i> 保存更改
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 侧边栏切换
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');

            sidebarToggle.addEventListener('click', function () {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });

            overlay.addEventListener('click', function () {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });

            // 设置导航项点击
            const navItems = document.querySelectorAll('.nav-item');

            navItems.forEach(item => {
                item.addEventListener('click', function (e) {
                    e.preventDefault();
                    navItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');

                    // 这里可以添加加载对应设置内容的代码
                    const tabName = this.querySelector('span').textContent;
                    document.querySelector('.content-title').textContent = tabName;
                    console.log('切换到设置: ' + tabName);
                });
            });

            // 文件上传处理
            const fileInputs = document.querySelectorAll('.file-input');

            fileInputs.forEach(input => {
                input.addEventListener('change', function () {
                    const label = this.nextElementSibling;
                    if (this.files && this.files[0]) {
                        label.innerHTML = `<i class="fas fa-file"></i> ${this.files[0].name}`;
                    }
                });
            });

            // 备份操作按钮
            const backupActions = document.querySelectorAll('.backup-actions button');

            backupActions.forEach(button => {
                button.addEventListener('click', function () {
                    const action = this.querySelector('i').className.split(' ')[1];
                    const backupTitle = this.closest('.backup-card').querySelector('.backup-title').textContent.trim();

                    let actionText = '';
                    if (action === 'fa-download') actionText = '下载';
                    else if (action === 'fa-undo') actionText = '恢复';
                    else if (action === 'fa-trash') actionText = '删除';

                    alert(`即将${actionText}备份: ${backupTitle}`);
                    // 这里可以添加实际的备份操作逻辑
                });
            });
        });
    </script>
</body>

</html>